/**
 * 页面相关
 */
import request from '@/utils/request'

// ==========  页面基础 ==========
/**
 * @method getPageList
 * @description 获取页面列表
 */
export function getPageList(params) {
  return request({
    url: '/wx/biz/wxa/custom/page/list',
    method: 'get',
    params: params
  })
}

/**
 * @method addPage
 * @description 新增页面
 */
export function addPage({ params, data }) {
  return request({
    url: '/wx/biz/wxa/custom/page/add',
    method: 'post',
    data: data,
    params: params
  })
}

/**
 * @method deletePage
 * @description 删除页面
 */
export function deletePage(params) {
  return request({
    url: '/wx/biz/wxa/custom/page/delete',
    method: 'delete',
    params: params
  })
}

/**
 * @method getPageConfig
 * @description 获取页面基础配置
 */
export function getPageConfig(params) {
  return request({
    url: '/wx/biz/wxa/custom/page/config',
    method: 'get',
    params: params
  })
}

/**
 * @method editPageConfig
 * @description 保存页面基础配置
 */
export function editPageConfig(params, data) {
  return request({
    url: '/wx/biz/wxa/custom/page/config',
    method: 'post',
    data: data,
    params: params
  })
}
/**
 * @method editPubPageConfig
 * @description 保存公域页面基础配置
 */
export function editPubPageConfig(data) {
  return request({
    url: '/wx/biz/wxa/custom/page/config',
    method: 'post',
    data: data
  })
}

// ==========  页面内容相关 ==========
/**
 * @method getPageData
 * @description 获取页面数据配置
 */
export function getPageData(params) {
  return request({
    url: '/wx/biz/wxa/custom/page/data',
    method: 'get',
    params: params
  })
}

/**
 * @method editPageData
 * @description 保存页面数据配置
 */
export function editPageData({ data, params }) {
  return request({
    url: '/wx/biz/wxa/custom/page/data',
    method: 'post',
    params: params,
    data: data
  })
}
